﻿using System;
using System.Text;
using System.Collections.Generic;
using System.Linq;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using NPMonitor.DataModel;

namespace NPMonitor.Library.Tests.DataModel.Scheduling
{
    [TestClass]
    public class CalendarScheduleTest
    {
        [TestMethod]
        public void GetNextOccurrenceTest()
        {
            CalendarSchedule cs = new CalendarSchedule();
            cs.StartDateTime = Helpers.Utils.CurrentServerUtcTime;
            cs.RepeatInterval = TimeSpan.FromHours(4);
            cs.StartDailyAt(new TimeOfDay()
            {
                Hour = 7
            });

            HashSet<DayOfWeek> dayOfWeek = new HashSet<DayOfWeek>();
            dayOfWeek.Add(DayOfWeek.Wednesday);
            dayOfWeek.Add(DayOfWeek.Thursday);

            cs.DaysOfWeek = dayOfWeek;

            DateTime? accureDate = cs.GetNextOccurrence(Helpers.Utils.CurrentServerUtcTime);
        }
    }
}
